package com.chinaums.format.option;


public class SftpCsvOption {

    private final String columnDelimiter;
    private final boolean ignoreParseErrors;


    private final String lineDelimiter;


    public String getColumnDelimiter() {
        return columnDelimiter;
    }

    public boolean isIgnoreParseErrors() {
        return ignoreParseErrors;
    }

    public String getLineDelimiter() {
        return lineDelimiter;
    }

    public static Builder builder() {
        return new Builder();
    }

    public SftpCsvOption(String columnDelimiter, boolean ignoreParseErrors,String lineDelimiter) {
        this.columnDelimiter = columnDelimiter;
        this.ignoreParseErrors = ignoreParseErrors;
        this.lineDelimiter=lineDelimiter;
    }

    public static class Builder {
        private String columnDelimiter;
        private boolean ignoreParseErrors;
        private String lineDelimiter;

        public Builder setColumnDelimiter(String columnDelimiter) {
            this.columnDelimiter = columnDelimiter;
            return this;
        }

        public Builder setIgnoreParseErrors(boolean ignoreParseErrors) {
            this.ignoreParseErrors = ignoreParseErrors;
            return this;
        }

        public Builder setLineDelimiter(String lineDelimiter) {
            this.lineDelimiter = lineDelimiter;
            return this;
        }

        public SftpCsvOption build() {

            return new SftpCsvOption(
                    columnDelimiter,
                    ignoreParseErrors,
                    lineDelimiter
            );
        }
    }

}
